import React, { useState, useEffect } from 'react';

export default function Counter() {
  const [count, setCount] = useState(0);

  useEffect(() => {
    document.title = `You clicked ${count} times`;
  });

  return (
    <div className='counter'>
      <p>You click {count} times</p>
      <button onClick={() => {
        setCount(count + 1);
      }}>Click me</button>
    </div>
  );
}